#coding:utf-8
from django.http import HttpResponse,HttpResponseRedirect
from django.shortcuts import render
import json


def getLoginUserId(req):
  '获取登录用户id'
  id=0
  userinfo=[]
  try:
    userinfo=req.session['userinfo']
    id=userinfo['id']
  except KeyError:
    pass
  return id
  
def getLoginUsername(req):
  '获取登录用户名'
  str=""
  userinfo=[]
  try:
    userinfo=req.session['userinfo']
    str=userinfo['username']
  except KeyError:
    pass
  return str
  
def getLoginPwd(req):
  '获取登录用户密码'
  str=""
  userinfo=[]
  try:
    userinfo=req.session['userinfo']
    str=userinfo['password']
  except KeyError:
    pass
  return str
  
